﻿

int i = 9;
long j = 9;

string k = "91234qwe";
char g = '9';

float z = 9.0f;
double b = 9.0;

Console.WriteLine(double.MaxValue);
Console.WriteLine(float.MaxValue);

//自定义类型
CPerson person = new CPerson(30);
Console.WriteLine(person.mAge);
//调用函数
person.addAge(10);
//40
Console.WriteLine(person.mAge);
CPerson.show();
//float tar = person.ageAndHeight();
//40
//Console.WriteLine(tar);

CPerson m = new CMan(40);
m.doSport();
//新手村 继承场景
//背包 装备面板 实际游戏如果运用的

//人：身高(float) 年龄(int) 
public class CPerson
{
    //通用功能
    public static void show()
    {
        Console.WriteLine("老朱说啊说");
    }
    public float mHeight;
    public int mAge;
    //构造函数,初始化作用
    public CPerson(int age)
    {
        Console.WriteLine("new CPerson");
        mAge = age;
    }

    //使我们的代码更加逻辑化
    public void addAge(int age)
    {
        mAge = mAge + age;
        float re = _ageAndHeight();
        //mAge = mAge+1
    }

    //默认私有 private
    float _ageAndHeight()
    {
        return mAge + mHeight;
    }

    public virtual void doSport()
    {
        Console.WriteLine("跑步");
    }
}

public class CMan : CPerson
{
    public CMan(int age) : base(age)
    {
        Console.WriteLine("new CMan");
    }

    //如果我们需要不同行为，那就可以通过重载 多态
    //如果不需要
}





